module.exports = {
  async delay(time) {
    return new Promise(resolve => {
      let timer = null;
      timer = setTimeout(() => {
        resolve(timer);
      }, time);
    });
  },
  async sseMessage(data) {

    this.sseStream.write("event: message\n");
    this.sseStream.write(`data: ${JSON.stringify(data)}\n`);
    this.sseStream.write("\n\n");
  },
};
